package dto

// ResourceQueryParams 资源查询参数
type ResourceQueryParams struct {
	Name   string `form:"name"`
	Code   string `form:"code"`
	Type   *int8  `form:"type"`
	Status *int8  `form:"status"`
}

// ResourceCreateRequest 创建资源请求
type ResourceCreateRequest struct {
	ParentID  uint   `json:"parentId"`
	Type      int8   `json:"type" binding:"required,oneof=1 2"`
	Name      string `json:"name" binding:"required,min=2,max=50"`
	Code      string `json:"code" binding:"required,min=2,max=100"`
	Path      string `json:"path"`
	Component string `json:"component"`
	Icon      string `json:"icon"`
	Sort      int    `json:"sort"`
	IsHidden  bool   `json:"isHidden"`
	IsCache   bool   `json:"isCache"`
	Status    int8   `json:"status" binding:"omitempty,oneof=0 1"`
	Remark    string `json:"remark"`
}

// ResourceUpdateRequest 更新资源请求
type ResourceUpdateRequest struct {
	ParentID  uint   `json:"parentId"`
	Type      int8   `json:"type" binding:"omitempty,oneof=1 2"`
	Name      string `json:"name" binding:"omitempty,min=2,max=50"`
	Code      string `json:"code" binding:"omitempty,min=2,max=100"`
	Path      string `json:"path"`
	Component string `json:"component"`
	Icon      string `json:"icon"`
	Sort      int    `json:"sort"`
	IsHidden  bool   `json:"isHidden"`
	IsCache   bool   `json:"isCache"`
	Status    int8   `json:"status" binding:"omitempty,oneof=0 1"`
	Remark    string `json:"remark"`
}
